<?php include HEADER; ?>
<?php include SIDEBAR ; ?>
<div class="wrap-right">
<!--scroll-->
<div class="pl-scroll">
	<h3 class="pl-c-title"> Top sản phẩm bán chạy nhất</h3>
	<a class="pl-c-l" href="javascript:;"></a>
	<div class="pl-c-c">
	  <ul class="ls pl-c-c-l" style="width:4700px" rel="4700">
	  <?php
		$hoadonModel = new hoadon();
		$lstsell = $hoadonModel->getBestSell();
		if($lstsell && count($lstsell)>0){
			foreach($lstsell as $item){
		?>
				<li>
				  <p class="image"> <a href="<?php echo __URL_BASE ?>tivi/chi-tiet-san-pham/<?php echo $item->idTivi ?>/<?php echo utility::utf8tourl(trim($item->TenTivi));  ?>.html" title="<?php echo $item->TenTivi ?>"> <img title="<?php echo $item->TenTivi ?>" alt="<?php echo $item->TenTivi ?>" src="<?php echo __URL_BASE ?>images/<?php echo utility::setImageThumb($item->Images,$item->Images2,$item->Images3,$item->Images4,$item->Images5); ?>"> </a> </p>
				  <p class="brand"> <?php echo $item->TenHang ?> </p>
				  <p class="name"> <a href="<?php echo __URL_BASE ?>tivi/chi-tiet-san-pham/<?php echo $item->idTivi ?>/<?php echo utility::utf8tourl(trim($item->TenTivi));  ?>.html" title="<?php echo $item->TenTivi ?>"> <?php echo $item->TenTivi ?> </a> </p>
				  <div class="price">
					  <div class="price-number-small"> <?php echo number_format($item->GiaBan,0,'','.') ?>đ </div>
					  <div class="cl"> </div>
					</div>
					<p class="price2"> <?php echo number_format($item->GiaThat,0,'','.') ?>đ </p>
				  <p class="type-hot"> <span>GIẢM</span> <?php echo number_format($item->GiaThat - $item->GiaBan,0,'','.') ?>đ </p>
				</li>
		<?php		
			}
		}
	  ?>
		
		
	  </ul>
	</div>
	<a class="pl-c-r" href="javascript:;"></a>
	<div class="cl"> </div>
  </div>
  <div class="cl"> </div>
<!--end scroll-->
<!--show list product-->
<div class="temp-pro temp-pro-list" style="margin-top:10px;">
        <ul class="ls ph-list-menu">
        </ul>
        <div class="cl"> </div>
        <!--if isset product && have least 1 product-->
        <?php if($lstTivi && count((array)$lstTivi) > 0):  ?>
            <ul class="ls temp-pro-item">
            <?php $i = 0; // position item variable ?>
            <!--loop product-->
            <?php foreach($lstTivi as $item): ?>
              <?php 
			  	$temp = $i + 1;
			  	$top =  252 * (ceil($temp/4)-1);
				$left = 244 * ($i%4);
				//echo $top . " va " . $left;
			  ?>
              
              <li class="temp-pro-item-li"  style="top:<?php echo $top ?>px;left:<?php echo $left ?>px">
                <!--<p class="type-discount"> -6% </p>-->
                <p class="icon-cr  "> </p>
                <p class="image"> 
                	<a class="zp" href="<?php echo __URL_BASE ?>tivi/chi-tiet-san-pham/<?php echo $item->id ?>/<?php echo utility::utf8tourl(trim($item->TenTivi));  ?>.html" title="<?php echo $item->TenTivi ?> " > 
                    	<img src="<?php echo __URL_BASE ?>images/<?php echo utility::setImageThumb($item->Images,$item->Images2,$item->Images3,$item->Images4,$item->Images5); ?>" title="<?php echo $item->TenTivi ?> " alt="TV LCD/LED SONY 32R402A 32 inches HD Ready Motionflow XR 100 Hz"> 
                    </a> 
                </p>
                <p class="brand"> <?php echo $item->TenHang ?>  </p>
                <p class="name"> 
                	<a class="zp" href="<?php echo __URL_BASE ?>tivi/chi-tiet-san-pham/<?php echo $item->id ?>/<?php echo utility::utf8tourl($item->TenTivi);  ?>.html" title="<?php echo $item->TenTivi ?> " rel="tivi-lcdled-sony-32r402a">
						<?php echo $item->TenTivi ?> 
                    </a> </p>
                <div class="price">
                  <div class="price-number-small"> <?php echo number_format($item->GiaBan,0,'','.') ?>đ </div>
                  <div class="cl"> </div>
                </div>
                <p class="price2"> <?php echo number_format($item->GiaThat,0,'','.') ?>đ </p>
                <div class="cl"> </div>
                <div class="temp-pro-item-content"> </div>
                <div class="cl"> </div>
              </li>
              <?php $i++ ?>
            <?php endforeach; ?>
            <!--end loop product-->
            </ul>
            <div class="cl"> </div>
            <div class="cl" style="min-height:520px"> </div>
            
           <!-- pagination-->
           
            <?php utility::pagination($pages); ?>
            
           <!--end pagination-->
     	<?php endif;?>
        <div class="cl"> </div>
      </div>
<!--end show list product-->
	

</div>
<?php include FOOTER; ?>
